package com.he.DesignPatterns.Responsibility;

import java.text.MessageFormat;

/**
 * @description: 总经理类
 * @Author: HCL
 * @Date: 2024/9/4 9:27
 */
public class GeneralManager extends Handler {

    public GeneralManager() {
        super(Handler.NUM_THREE, Handler.NUM_FIVE);
    }

    @Override
    protected void handleLeave(LeaveRequest leaveRequest) {
        System.out.println(MessageFormat.format("{0}请假{1}天,{2}",
                leaveRequest.getName(), leaveRequest.getNum(), leaveRequest.getContent()));
//        if (leaveRequest.getNum() > Handler.NUM_ONE){
//            System.out.println("请假天数超过最长请假时间，不同意");
//        }else{
//            System.out.println("总经理审批：同意");
//        }

        String printString  = "";
        printString = leaveRequest.getNum() > Handler.NUM_ONE ? "请假天数超过最长请假时间，不同意" : "总经理审批：同意";
        System.out.println(printString);
    }
}
